from collections import OrderedDict

od = OrderedDict()
od['foo'] = 1
od['bar'] = 2
od['spam'] = 3
od['grok'] = 4
print(od)
for key in od:
    print(key,od[key])

for key, value in od.items():
    print(key,'=',value)

